const Router = require('koa-router')
//

const {
  create,
  get,
  list,
  del,
  systems,
} = require('../../../controller/v1/admin/owner')

const {
  createValidator,
  delValidator,
  listValidator,
  getValidator,
} = require('../../../middleware/validator/v1/owner')

const { validateToken } = require('../../../middleware/auth/token')

const { reqLog } = require('../../../middleware/log/log')

const PREFIX = '/v1/admin/owner'

const router = new Router({ prefix: PREFIX })

router.get('/get', validateToken, getValidator, get)

// 后端管理员权限
router.post('/create', validateToken, createValidator, reqLog, create)

// 后端管理员权限
router.del('/del', validateToken, delValidator, reqLog, del)

// 后端管理员权限
router.get('/list', validateToken, listValidator, list)

router.get('/systems', validateToken, systems)

module.exports = router
